namespace Myclass {
	interface Person {
		name: string
		age: number
		message?: string | undefined

	}
	class Person implements Person {
		/**
		*	这是一个构造函数的TSDoc注释
		* @param name - 人的名字
		* @param age - 人的年龄
		* @param message - (可选)附加信息
		*/
		constructor(name: string, age: number, message?: string | undefined) {
			this.name = name;
			this.age = age;
			this.message = message;
		}
	}
	let su = new Person('苏陈凤', 23, '我是苏大王')
	console.log(su);

	interface Product {
		readonly id: number
		name: string
		price: number
		description?: string | undefined

	}
	const product1: Product = {
		id: 1,
		name: 'iPhone 14 Pro',
		price: 9999

	}
	console.log(product1);


	type Add = (a: number, b: number) => number;

	const add: Add = (a, b) => a + b;

	console.log(add(5, 3));


	type Greet = (name?: string | undefined) => string;
	const greet: Greet = (name) => `Hello, ${name || 'World'}`;
	console.log(greet());

	type CreateUser = (name: string, age: number) => { name: string; age: number };

	const createUser: CreateUser = (name, age) => ({ name, age });

	console.log(createUser("张三", 30));


	interface User { name: string; age: number; }
	interface Contact { email: string; phone: string; }


}
